//request是一个axios对象（经过设置信息的）
import request from '@/utils/request'

export function userLogin(data) {
    return request({
        url: '/api/user/login',
        //post请求
        method: 'post',
        data
    })
}
////////////////////////////////////////////////////////////////
export function myClassPage(data) {
    return request({
        url: '/api/user/myClassPage',
        method: 'post',
        data
    })
}
export function teacherExaminingCoursePage(data) {
    return request({
        url: '/api/user/examiningCoursePage',
        method: 'post',
        data
    })
}

export function myTextPages(data) {
    return request({
        url:'/api/user/myTextPages',
        method:'post',
        data
    })
}

export function myExaminingTextPages(data) {
    return request({
        url:'/api/user/myExaminingTextPages',
        method:'post',
        data
    })
}
////////////////////////////////////////////////////////////////
export function userRegister(data) {
    return request({
        url: '/api/user/register',
        method: 'post',
        data
    })
}

export function selectUserMessage(data) {
    return request({
        url: `/api/user/selectUserMessage/${data}`,
        method: 'post',
    })
}

export function selectUserById(data) {
    return request({
        url: '/api/user/selectUserById',
        method: 'post',
        data
    })
}



export function updateUserMessage(data) {
    return request({
        url: '/api/user/updateUserMessage',
        method: 'post',
        headers: {'Content-Type':'multipart/form-data'},
        data
    })
}
//检索全部用户
export function selectAllUsers(data) {
    return request({
        url: '/api/user/selectAllUsers',
        method: 'post',
        data
    })
}

export function selectAllTeachers(data) {
    return request({
        url: '/api/user/selectAllTeachers',
        method: 'post',
        data
    })
}
//设置封禁
export function setUserBanned(data) {
    return request({
        url: `/api/user/setUserBanned/${data}`,
        method:'post'
    })
}
//设置启用
export function setUserEnable(data) {
    return request({
        url: `/api/user/setUserEnable/${data}`,
        method:'post'
    })
}

export function userCount() {
    return request({
        url: '/api/user/userCount',
        method: 'post'
    })
}

export function userOrdinaryCount() {
    return request({
        url: '/api/user/userOrdinaryCount',
        method: 'post'
    })
}

export function userVipCount() {
    return request({
        url: '/api/user/userVipCount',
        method: 'post'
    })
}

export function teacherCount() {
    return request({
        url: '/api/user/teacherCount',
        method: 'post'
    })
}

export function teacherOrdinaryCount() {
    return request({
        url: '/api/user/teacherOrdinaryCount',
        method: 'post'
    })
}

export function teacherVipCount() {
    return request({
        url: '/api/user/teacherVipCount',
        method: 'post'
    })
}


export function refuseToTeacher(data) {
    return request({
        url: `/api/user/refuseToTeacher/${data}`,
        method: 'post',
    })
}

export function launchToTeacher(data) {
    return request({
        url: '/api/user/launchToTeacher',
        method: 'post',
        headers: {'Content-Type':'multipart/form-data'},
        data
    })
}

export function acceptToTeacher(data) {
    return request({
        url: `/api/user/acceptToTeacher/${data}`,
        method: 'post',
    })
}

export function launchingTeacher(data) {
    return request({
        url: '/api/user/launchingTeacher',
        method: 'post',
        data
    })
}

export function signOutUser(data) {
    return request({
        url: `/api/user/signOutUser/${data}`,
        method: 'post',
    })
}

export function resetPassword(data) {
    return request({
        url: '/api/user/resetPassword',
        method: 'post',
        data
    })
}
//关注api
export function isFollowed(data) {
    return request({
        url: '/api/user/isFollowed',
        method: 'post',
        data
    })
}
export function follow(data) {
    return request({
        url: '/api/user/follow',
        method: 'post',
        data
    })
}

export function unFollow(data) {
    return request({
        url: '/api/user/unFollow',
        method: 'post',
        data
    })
}

export function myFollows(data) {
    return request({
        url: '/api/user/myFollows',
        method: 'post',
        data
    })
}

export function myFans(data) {
    return request({
        url: '/api/user/myFans',
        method: 'post',
        data
    })
}

export function myFollowCount(data) {
    return request({
        url: '/api/user/myFollowCount',
        method: 'post',
        data
    })
}

export function myFansCount(data) {
    return request({
        url: '/api/user/myFansCount',
        method: 'post',
        data
    })
}

export function selectMyFollowCourse(data) {
    return request({
        url: '/api/user/selectMyFollowCourse',
        method: 'post',
        data
    })
}

